package com.unit_7.util;

public class Square extends Shape {
    double side;
    public Square(){
        this.side = 0.0;
    }
    public Square(double side){
        this.side = side;
    }
    @Override
    public double getArea(){
        return side * side;
    }
    @Override
    public double getPerimeter(){
        return 4 * side;
    }

    public static void main(String[] args) {
        Square square = new Square(2);
        System.out.println("正方形的面积为：" + square.getArea());
        System.out.println("正方形的周长为：" + square.getPerimeter());
    }
}
